home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / image / savers_.zip / BGI256.DOC < prev    next >
Text File  |  1993-04-24  |  53KB  |  1,404 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                   BGI256 driver
  9.                          Copyright 1991,1993 Knight Software
  10.                                 as of 17 Apr 1993
  11.  
  12.  
  13.         The BGI256 driver is a BGI driver for Super VGA cards using 
  14.         256 colors. The most popular 256 color modes are supported.
  15.         With this release of the driver, protected mode operation is now 
  16.         supported.
  17.  
  18.         Mode     Description   Memory    Who uses it
  19.          0       320x200x256 : (64K)     Standard VGA and MCGA
  20.          1       640x400x256 : (256K)    Some Super VGAs
  21.          2       640x480x256 : (512K)    Most Super VGAs
  22.          3       800x600x256 : (512K/1M) Some Super VGAs
  23.          4      1024x768x256 : (1M)      Some Super VGAs
  24.          5     1280x1024x256 : (2M)      Some Super VGAs
  25.  
  26.  
  27.         The BGI256 driver supports most of the Graphics commands with a 
  28.         few exceptions. Additionally, I have added some extensions to the 
  29.         capabilities of the BGI driver beyond the functionality of the 
  30.         standard BGI drivers. These extensions do not affect the normal 
  31.         use of the BGI driver with regular programs. The extensions allow 
  32.         for greater flexibility in the use of the driver and various 
  33.         drawing functions. 
  34.  
  35.         The driver works with the standard Borland graphics commands. For 
  36.         the operation of the graphics commands refer to your Pascal or C 
  37.         language reference manual. 
  38.  
  39.         It should be noted that the BGI driver was originally designed 
  40.         for use with the Hercules, CGA and EGA displays. It does not have 
  41.         full support capability for VGA type displays, and in fact has 
  42.         some limitations placed on it by the EGA specific code. Every 
  43.         attempt was made to keep the operation as similar as possible to 
  44.         the Borland supplied BGI drivers, but because of the limitations 
  45.         imposed by Borland's GRAPH code some functions do not work 
  46.         exactly the same, or do not work at all. 
  47.  
  48.         The following list of commands describe the exceptions or 
  49.         limitations of the graphics commands that are not fully 
  50.         supported, supported differently, or have been extended in this 
  51.         driver. Graphics functions that are not listed here continue to 
  52.         operate exactly as specified in the language reference manual. 
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                         1
  62.  
  63.  
  64.  
  65.         Pascal: function AutoDetect : integer;
  66.         C, C++: int huge autodetect(void);
  67.  
  68.         The AutoDetect function is not a library function but rather code 
  69.         that you must write yourself if you are going to be using 
  70.         autodetection for a non-Borland supplied BGI driver. You can 
  71.         label the function any name that you wish as long as you pass a 
  72.         pointer to the function to the InstallUserDriver when it is 
  73.         called. If you are not going to be supplying an autodetect 
  74.         function, then you should pass a nil pointer to the 
  75.         InstallUserDriver function. 
  76.  
  77.         Note: In TP5.0 and TP5.5 you must use the Autodetection method 
  78.         due to a bug in the graph unit which causes the InstallUserDriver 
  79.         function to return a bad number.
  80.  
  81.         The AutoDetect function can be used to determine if the hardware 
  82.         is installed in the computer, and the Borland manuals indicate 
  83.         that this is it's function. I consider this poor practice however 
  84.         since it places hardware dependent code in the main program which 
  85.         defeats the purpose of the BGI driver which is to remove hardware 
  86.         dependencies from the main program code. The BGI256 driver 
  87.         provides the hardware detection as a part of the driver itself. 
  88.         The detection is performed during the InitGraph (and as a side 
  89.         effect in the SetGraphMode function). 
  90.  
  91.         Normally you would pass the mode selection that you wish the 
  92.         display to start up in. Sometimes that is not always possible, 
  93.         especially with the Super VGA displays where you cannot be 
  94.         certain what modes are available until the display has been 
  95.         initialized with the InitGraph function. 
  96.  
  97.         To solve that problem, if a mode value that is outside the range 
  98.         of available modes is passed to the driver it will go into 
  99.         auto-mode detection. This will cause the driver to ignore the 
  100.         mode value and place the driver into the default mode. This 
  101.         prevents setting the display to a non-supported mode while still 
  102.         allowing the main program to be non-hardware specific. 
  103.  
  104.         The only problem with this is that the GRAPH unit will think that 
  105.         the mode selected is 127. To get around this limitation, an 
  106.         extended function has been provided to cause the GetMaxMode 
  107.         function to return the currently selected mode by calling 
  108.         SetWriteMode($E0+25) before calling GetMaxMode. The GetGraphMode 
  109.         function will not contain a proper value until a SetGraphMode 
  110.         call is made with a supported mode passed as the mode value.
  111.         Because of this, it is recommended that the GetMaxMode method be 
  112.         used if you use the auto-mode detection scheme. 
  113.  
  114.         The same effect will occur if you pass the auto-mode value as a 
  115.         mode value to the InitGraph function along with the desired 
  116.         Driver number, or if the driver is unable to select the mode that 
  117.         is passed. In all cases the grInvalidMode error will be returned.
  118.  
  119.  
  120.  
  121.  
  122.                                         2
  123.  
  124.  
  125.  
  126.         -----------------------------------------------------------------
  127.  
  128.         Pascal: procedure DetectGraph
  129.                                 (var GraphDriver, GraphMode : integer);
  130.         C, C++: void far detectgraph
  131.                             (int far *graphdriver, int far *graphmode);
  132.  
  133.         The DetectGraph function is used to detect the presence of one of 
  134.         the standard Borland supported display cards. This function will 
  135.         NOT call the AutoDetect function addressed by the 
  136.         InstallUserDriver function. If you wish to detect the presence of 
  137.         a non-Borland supplied driver, then you must first call the 
  138.         appropriate AutoDetect routine yourself.
  139.  
  140.         This function doesn't normally have to be used unless you wish to 
  141.         override the driver/mode numbers normally determined by the 
  142.         detection function and you intend to use one of the Borland 
  143.         supplied BGI drivers.
  144.  
  145.         The DetectGraph function is automatically called by the InitGraph 
  146.         function when the GraphDriver number passed is zero. If you call 
  147.         DetectGraph yourself, the number provided in GraphDriver is 
  148.         ignored, and the number for the Borland supplied driver that fits 
  149.         the determined display card is passed back in GraphDriver 
  150.         variable. The Mode number is set to the maximum mode number that 
  151.         is available for the detected display system. These numbers can 
  152.         then be used with the InitGraph function to actually initialize 
  153.         the graphics system. 
  154.  
  155.         If you wish to autodetect the BGI256 driver, then you must call 
  156.         your own AutoDetect routine to test for the driver before 
  157.         attempting to call the DetectGraph function. If you don't do 
  158.         this, then this driver will not be detected.
  159.  
  160.         See also:
  161.           AutoDetect, InitGraph, RegisterBGIdriver, InstallUserDriver
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.                                         3
  184.  
  185.  
  186.  
  187.         -----------------------------------------------------------------
  188.  
  189.         Pascal: procedure FloodFill(X, Y : integer; Border : word);
  190.         C, C++: void far floodfill(int x, int y, int border);
  191.  
  192.         The Floodfill function is now fully supported in V3.00. You can 
  193.         select either Border Fill (default), or Seed Fill operation. The 
  194.         FillPattern controls the floodfill color and pattern that will be 
  195.         used (see SetFillPattern